﻿using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using K9Nano.Domain;

namespace K9Nano.Authorization
{
    /// <summary>
    /// RBAC中角色可访问的资源
    /// </summary>
    [Table("AppRoleResource")]
    public class RoleResource : Entity, ICreationAudited, IMayHaveTenant
    {
        [Required]
        [StringLength(50)]
        public string Api { get; set; }
        [Required]
        [StringLength(100)]
        public string Role { get; set; }
        [Required]
        [StringLength(100)]
        public string Resource { get; set; }

        public Guid? CreatorUserId { get; set; }
        public DateTimeOffset CreationTime { get; set; }

        public Guid? TenantId { get; set; }
    }
}